<?

class ToolBar
{
    var $buttons;

    function ToolBar() {
        $BUTTONS = Config::getValue('buttons','BUTTONS');
        foreach ($BUTTONS as $button) {
            if ($button == '|') {
                $this->buttons[] = new Separator();
            } elseif ($button == '/') {
                $this->buttons[] = new LineBreak();
            } else {
                require 'buttons/'.$button.'.button.php';
                $this->buttons[strtolower($button)] = new $button();
            }
        }
    }

    function render($sel) {
        $res = '<table height="20" width="1%"><tr>';
        foreach ($this->buttons as $button) {
            $res .= $button->render($sel);
        }

        return $res.'</tr></table>';
    }


}

?>